﻿using System;
using System.ComponentModel;
using System.Xml.Serialization;

namespace Landpy.CruiseControlNet.FacadeInterface.ConfigurationModule
{
    public class Subject : IPrimaryKey
    {
        [Browsable(false)]
        [XmlIgnore]
        public Guid Id { get; private set; }

        [Category("Basic")]
        [Description("A build result state, see below for the possible values.")]
        [XmlAttribute("buildResult")]
        public BuildResultType BuildResultType { get; set; }

        [Category("Basic")]
        [Description("The value of the subject line, the text to be used for the subject. This may contain variables, see below. " +
                     "\r\n[${CCNetProject}] build successfully! " +
                     "\r\n[${CCNetProject}] ${CCNetBuildDate} broken by ${CCNetFailureUsers}! " +
                     "\r\n[${CCNetProject}] still broken, it isn't fixed! " +
                     "\r\n[${CCNetProject}] issue is already fixed! " +
                     "\r\n[${CCNetProject}] occur exception, please check the TFS.")]
        [XmlAttribute("value")]
        public string Value { get; set; }

        public Subject()
        {
            this.Id = Guid.NewGuid();
        }
    }
}